home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.1 KB | 119 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLStrRun.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
-
- /*
- * This file was generated by the SOM Compiler.
- * Generated using:
- * SOM Emitter emitxtm.dll: 2.33
- */
-
- #include "FWFound.hpp"
-
- #ifndef SLSTRREP_H
- #include "SLStrRep.h"
- #endif
-
- #ifndef SOM_Module_ODFStringSubsystem_defined
- #include "FWTxtTyp.xh"
- #endif
-
- #ifndef FWDEBUG_H
- #include "FWDebug.h"
- #endif
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- #ifndef PRSTRREP_H
- #include "PRStrRep.h"
- #endif
-
- #define FW_OStringRunWriter_Class_Source
- #include "SLStrRun.xih"
-
- #ifdef FW_BUILD_WIN
- #define corbastring string
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment Strings
- #endif
-
- SOM_Scope FW_OStringRunWriter* SOMLINK FW_OStringRunWriter__Initialize(FW_OStringRunWriter *somSelf, Environment *ev,
- FW_HString theString,
- short bufferSize)
- {
- FW_SOM_TRY
- {
- FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
-
- FW_ASSERT(theString->fLocked);
- somThis->fString = theString;
- FW_PrivString_Acquire(somThis->fString);
- somThis->fBufferSize = bufferSize;
- somThis->fBuffer = new char[bufferSize];
- }
- FW_SOM_CATCH
- return somSelf;
- }
-
- SOM_Scope void SOMLINK FW_OStringRunWriter__somInit(FW_OStringRunWriter *somSelf)
- {
- FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
- somThis->fBufferSize = 0;
- somThis->fBuffer = 0;
- // FW_OStringRunWriter_parent_FW_OTextRunWriter_somInit(somSelf);
- }
-
- SOM_Scope void SOMLINK FW_OStringRunWriter__somUninit(FW_OStringRunWriter *somSelf)
- {
- FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
- delete [] somThis->fBuffer;
- FW_PrivString_Release(somThis->fString);
- // FW_OStringRunWriter_parent_FW_OTextRunWriter_somUninit(somSelf);
- }
-
- SOM_Scope corbastring SOMLINK FW_OStringRunWriter__GetCurrentRun(FW_OStringRunWriter *somSelf, Environment *ev,
- FW_ByteCount* length)
- {
- FW_UNUSED(ev);
- FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
- *length = somThis->fBufferSize;
- return somThis->fBuffer;
- }
-
- SOM_Scope void SOMLINK FW_OStringRunWriter__FlushRun(FW_OStringRunWriter *somSelf, Environment *ev,
- corbastring buffer,
- FW_ByteCount bytesToFlush)
- {
- FW_PlatformError error;
- FW_OStringRunWriterData *somThis = FW_OStringRunWriterGetData(somSelf);
- FW_SPrivStringRep* rep = FW_PrivString_AppendBytes(somThis->fString, buffer, bytesToFlush, &error);
- FW_ASSERT(somThis->fString == rep);
- FW_SetEvError(ev, error);
- }
-
- SOM_Scope boolean SOMLINK FW_OStringRunWriter__NewRun(FW_OStringRunWriter *somSelf, Environment *ev, FW_Locale* locale)
- {
- FW_UNUSED(somSelf);
- FW_UNUSED(ev);
- FW_UNUSED(locale);
- return false;
- }
-
- SOM_Scope void SOMLINK FW_OStringRunWriter__GetLocale(FW_OStringRunWriter* somSelf, Environment* ev,
- FW_Locale* locale)
- {
- FW_UNUSED(ev);
- FW_OStringRunWriterData* somThis = FW_OStringRunWriterGetData(somSelf);
- FW_PrivString_GetLocale(somThis->fString, locale); // may throw
- }
-